export default {
  // 为当前模块开启命名空间
  namespaced: true,

  // 模块的 state 数据
  state: () => ({
    address: uni.getStorageSync('address') || {}
  }),

  // 模块的 mutations 方法
  mutations: {
    updateAddress(state, newAddress){
      state.address = newAddress
      uni.setStorageSync('address', newAddress)
    }
  },

  // 模块的 getters 属性
  getters: {
    addstr(state){
      return `${state.address.provinceName}${state.address.cityName}${state.address.countyName}${state.address.detailInfo}`
    }
  },
}
